package com.k4rthik.clipall.network.profile;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * Created with IntelliJ IDEA.
 * User: k4rthik
 * Date: 4/6/12
 * Time: 10:55 AM
 */

public class Profile
{
    private int profileId;      // ID of this profile
    private String profileName; // Name of this profile

    private List<UUID> connectionIds;   // List of connections under this profile

    //Constructors
    public Profile(int _profileId)
    {
        this.profileId = _profileId;
        this.profileName = null;

        connectionIds = new ArrayList<UUID>();
    }

    public Profile(int _profileId, String _profileName)
    {
        this.profileId = _profileId;
        this.profileName = _profileName;

        connectionIds = new ArrayList<UUID>();
    }

    //Methods
    public int getProfileId()
    {
        return profileId;
    }

    public String getProfileName()
    {
        return profileName;
    }

    public List<UUID> getConnectionIds()
    {
        return connectionIds;
    }

    public boolean addConnection(UUID connectionId)
    {
        if(!hasConnection(connectionId)) {
            connectionIds.add(connectionId);
            return true;
        } else {
            return true;
        }
    }

    public boolean hasConnection(UUID connectionId)
    {
        return connectionIds.contains(connectionId);
    }
}
